<div class="extract block" data-title="取款" ms-controller="extract">
    <!-- 第一步 填写存款信息 -->
    <div :visible="@step==1">
        <a href="#" class="record"><i class="icon"></i> 取款记录</a>
        <h2 class="h2_title">取款</h2>
        <div class="hint" :visible='@withdrawalNum>0'>
            <i class="icon"></i>
            温韾提示：您目前有 <a href="#/deposit/backlog" class="primaryLink">{{@withdrawalNum}}个取款申请</a> 还未完成！
            <a href="#/deposit/backlog" class="primaryLink">查看详情</a>
        </div>

        <!-- 加载 -->
        <div class="queryLoad" :visible="@queryLoad"></div>

        <!-- 取款表单 -->
        <div class="form mtop20" :visible="!@queryLoad">
            <div class="grid_row">
                <div class="row-label">账号<span class="danger">*</span>：</div>
                <div class="row-content">
                    <select name="gts2AccountId" id="gts2AccountId" 
                            :duplex="@selPlatform" 
                            :change="@changeSelect('accTradeInfoList','selPlatform','platform','selAccount')">
                        <option :for="el in @accountInfo.accTradeInfoList" :attr="{'value':@el.platform}">{{@el.accountNo}}[{{@el.platformName}}]</option>
                    </select>
                </div>
            </div>
            <div class="grid_row">
                <div class="row-label">可取资金：</div>
                <div class="row-content">
                    <span class="fundNum">{{@accountAmount}}</span>
                    {{@selAccount.currencyName}}
                    <a href="javascript:;" class="refresh" :class="{'loading': @refreshLoading}" :click="@refreshFn">
                        <img src="../../../images/loading.gif" class="loadimg" />
                        <i class="refreshIcon"></i>
                        刷新
                    </a>
                </div>
            </div>
            <div class="grid_row">
                <div class="row-label">收款银行<span class="danger">*</span>：</div>
                <div class="row-content" >
                    <select name="bankInfoList"
                            :duplex="@selBankCode" 
                            :change="@changeSelect('bankInfoList','selBankCode','bank','selBank')">
                        <option :for="el in @bankInfoList" :attr="{'value':@el.bank}">{{@el.bankName+' '+@el.bankAccountNumber}}</option>
                    </select>
                    <div class="mtop5">
                        请核对资料，如有误请找 
                        <a class="customerLink" target="_blank" :attr="{href:@customerLink}">在线客服</a>
                    </div>
                </div>
            </div>
            <div class="grid_row">
                <div class="row-label">持卡人姓名<span class="danger">*</span>：</div>
                <div class="row-content">
                    {{@accountInfo.chineseName}}
                </div>
            </div>
            <div class="grid_row">
                <div class="row-label">取款金额<span class="danger">*</span>：</div>
                <div class="row-content">
                    <input type="text" class="textInput" 
                            :duplex="@transAmount | change" 
                            :on-change="@transAmountInput" 
                            :on-keyup="@transAmountInput" 
                            data-duplex-changed="@inputAmount" >
                    {{ @selAccount.currencyName}}
                </div>
            </div>
            <div class="grid_row">
                <div class="row-label">手续费：</div>
                <div class="row-content">
                    <span>{{(@feeInfo.totalFee ? feeInfo.totalFee : '0.00') +' '+@selAccount.currencyName}}</span>
                    <span class="muted" :visible="@feeInfo.totalFee>0">
                        <a href="javascript:;" class="what" :click="@feeDialog.display='block'"></a>
                        (仅供参考)
                    </span>
                </div>
            </div>
            <div class="grid_row">
                <div class="row-label">入账币种：</div>
                <div class="row-content">
                    <select name="currencyList"
                        :duplex="@selCurrencyCode" 
                        :change="@changeSelect('currencyList','selCurrencyCode','code','selCurrency')">
                        <option :for="el in @currencyList" :attr="{'value':@el.code}">{{@el['name'+@lang]}}</option>
                    </select>
                </div>
            </div>
            <div class="grid_row">
                <div class="row-label">系统汇率：</div>
                <div class="row-content">
                    {{@rate}} （仅供参考）
                </div>
            </div>
            <div class="grid_row">
                <div class="row-label">入账金额：</div>
                <div class="row-content">
                    <span class="extractMoney">{{(@feeInfo.payAmount ? @feeInfo.payAmount : '0.00')}}</span>
                    {{@selCurrency['name'+@lang]}} （仅供参考）
                </div>
            </div>
            <div class="grid_row">
                <div class="row-label">备注：</div>
                <div class="row-content">
                    <textarea name="remark" class="remark" :duplex="remark"></textarea>
                </div>
            </div>
            <div class="acTips" :visible="@extractActivity && @extractActivity.accoutShecmeList.length>0">
                若您申请取款，则
                <a href="javascript:;" class="primary" :click="@acRecordDialog.display='block'">{{@extractActivity.accoutShecmeList.length}}个活动</a>
                资格将会被取消，同时已赠送的金额
                <a href="javascript:;" class="primary" :click="@acRecordDialog.display='block'">（{{@extractActivity.sumBonusOutAmount+@extractActivity.currenyName}}）</a>
                将从账户中扣除，如有疑问，请联系客服。
            </div>
            <div class="grid_row mtop20">
                <div class="row-label">&nbsp;</div>
                <div class="row-content">
                    <button class="m-btn " 
                    :class="{loading:@submitLoad}"
                    :attr="{disabled:@submitLoad}"
                    :click="@submitfn | prevent">提交</button>
                    <button class="m-btn-default mleft10" ms-click="@resetFn">重设</button>
                </div>
            </div>
        </div>
    </div>

    <!-- 第二步 确认取款信息  -->
    <div class="depositConfirm" :visible="@step==2">
            <h2 class="h2_title">取款</h2>

        <div class="depositInfo mtop20">
            <div class="grid_row">
                <p class="row-label">账号：</p>
                <div class="row-content"> 
                    {{@selAccount.accountNo}}[{{@selAccount.platformName}}]
                </div>
            </div>
            <div class="grid_row">
                <p class="row-label">收款银行：</p>
                <div class="row-content"> 
                        {{@selBank.bankName+' '+@selBank.bankAccountNumber}}
                </div>
            </div>
            <div class="grid_row">
                <p class="row-label">持卡人姓名：</p>
                <div class="row-content"> 
                    {{@accountInfo.chineseName}}
                </div>
            </div>
            <div class="grid_row">
                <p class="row-label">取款金额：</p>
                <div class="row-content"> 
                    <span>{{@transAmount + @selAccount.currencyName}}</span>
                </div>
            </div>
            <div class="grid_row">
                <p class="row-label">手续费：</p>
                <div class="row-content"> 
                    <span class="num">{{@feeInfo.totalFee}}</span> {{@selAccount.currencyName}}
                </div>
            </div>
            <div class="grid_row">
                <p class="row-label">系统汇率：</p>
                <div class="row-content"> 
                    {{@rate}}  （仅供参考）
                </div>
            </div>
            <div class="grid_row">
                <p class="row-label">入账金额：</p>
                <div class="row-content"> 
                    <span class="num">{{@feeInfo.payAmount}}</span> {{@selCurrency['name'+@lang]}}
                </div>
            </div>
            <div class="grid_row" :visible="@valid">
                <p class="row-label">验证方式<span class="danger">*</span>：</p>
                <div class="row-content"> 
                    手机短信
                </div>
            </div>
            <div class="grid_row" :visible="@valid">
                <p class="row-label">验证码<span class="danger">*</span>：</p>
                <div class="row-content"> 
                    <input type="text" class="textInput" :duplex="validCode">
                    <button class="m-btn alidCodeBtn" 
                            :class="{disabled:@validLoad}"
                            :attr="{'disabled': @validLoad}"
                            :click="@getValidCode">
                            获取验证码 
                            <img src="../../../images/loading.gif" class="validLoadImg" :visible="@validLoad && @validLoadTime==''">
                            {{@validLoadTime}}
                    </button>
                    <p class="mtop5">
                        如未收到验证码请咨询
                        <a :attr="{href:@customerLink}" class="primary" target="_blank">在线客服</a>
                    </p>
                </div>
            </div>
            <div class="grid_row" :visible="@extractActivity && @extractActivity.accoutShecmeList.length>0">
                <p class="row-label">取消活动：</p>
                <div class="row-content"> 
                    <a href="javascript:;" class="showy" :click="@acRecordDialog.display='block'">
                        {{@extractActivity.accoutShecmeList.length}}个活动
                    </a>
                </div>
            </div>
            <div class="grid_row" :visible="@extractActivity && @extractActivity.accoutShecmeList.length>0">
                <p class="row-label">扣除赠金：</p>
                <div class="row-content"> 
                        <a href="javascript:;" class="showy" :click="@acRecordDialog.display='block'">
                            {{@extractActivity.sumBonusOutAmount+@extractActivity.currenyName}}
                        </a>
                </div>
            </div>
            <div class="grid_row">
                <p class="row-label">备注：</p>
                <div class="row-content"> 
                        <textarea name="remark" disabled class="remark" :duplex="remark"></textarea>
                </div>
            </div>
            <div class="grid_row">
                <p class="row-label">&nbsp;</p>
                <div class="row-content"> 
                    <button class="m-btn " 
                    :class="{loading:@submitLoad}"
                    :attr="{disabled:@submitLoad}"
                    :click="@confirmSubmit | prevent">确认</button>
                    <button class="m-btn-default mleft10" ms-click="@step=1">返回</button>
                </div>
            </div>
        </div>
    </div>

    <div class="tipBlock">
        <p class="label">
            <i class="icon"></i>
            注意事项：
        </p>
        <ul>
            <li>为免延误取款，递交取款指示前，请确认您以上的银行账户资料是否正确，取款金额会存回到您登记的银行账户。取款货币与您登记的银行账户货币相同。</li>
            <li>如非人民币之取款，公司需以电汇形式支付取款，支款银行、中转行及收款银行所需行政费用会于取款额度中扣除。</li>
            <li>入账货币金额仅供参考（可能产生手续费损耗）。</li>
            <li>系统汇率仅供参考，以实际银行处理汇率为准。</li>
            <li>单次取款少于50美元的取款，将统一收取3美元取款手续费。</li>
            <li>如果存款金额的50%不曾用于建仓交易，取款时将收取6%的手续费用。</li>
            <li>一般情况下取款最快2小时到账，详细的取款到账时间可<a href="http://www.24k.hk/zh/question_01.html" target="_blank" class="primary">按此</a>了解。</li>
            <li>若客户当天取款金额大于50万美金，我们将于2小时内处理款项，实际到账日期以银行安排为准，详情可<a :attr="{href:@customerLink}" class="primary">咨询客服</a>。</li>
            <li>
                本公司指定账户货币为美元，其他货币的存款，均由本公司公布的市场汇率兑换成美元，详情可参考以下
                <a href="javascript:;" class="primary" :click="@rateDialog.display='block'">兑换汇率注意事项</a>。
            </li>
            <li>假期或周末过市产品所需要保证金增加，请取款前留意资金状态。</li>
        </ul>
    </div>

    <!-- 兑换汇率注意事项  start -->
    <xmp is="ms-dialog" ms-widget="{dialog:@rateDialog}" >
        <p><strong>1. 兑换汇率来源</strong></p>
        <p class="mtop10">
            人民币与美元间兑换：参考本公司公布的
            <a href="http://oa.24k.hk/zh/exchange.html" target="_blank" class="primary">市场汇率</a>
            。港币与美元间兑换：香港恒生银行、中国银行或永亨银行公布的中间汇率，即美元买入价与卖出价的平均数。
        </p>
        <p class="mtop10"><strong>2. 汇率更新周期</strong></p>
        <p class="mtop10">汇率于香港时间凌晨生效，星期一至日每天更新一次。</p>
        <p class="mtop10"><strong>3. 汇率精确数字</strong></p>
        <p class="mtop10">汇率精确数字为小数点后两位，四舍五入。例如中国人民银行公布的人民币兑美元的汇率为：6.8318CNY/USD，则本公司使用6.83CNY/USD作为人民币兑美元的汇率进行换算，换算后显示的存取款金额也是精确到小数点后两位，四舍五入。</p>

    </xmp>
    <!-- 兑换汇率注意事项  start -->

    <!-- 手续费的弹窗  start -->
    <xmp is="ms-dialog" ms-widget="{dialog:@feeDialog}" >
        <table class="table">
            <thead>
                <tr>
                    <th :for="th in @feeDialog.thList">{{@th.label}}</th>
                </tr>
            </thead>
            <tbody>
                <tr :for="tr in @feeDialog.list">
                    <td :for="th in @feeDialog.thList"
                        :html="avalon.isFunction(@th.text) ? @th.text(@tr) : @tr[@th.text]"></td>
                </tr>
            </tbody>
        </table>
    </xmp>
    <!-- 手续费的弹窗  start -->

    <!-- 活动记录的弹窗  start -->
    <xmp is="ms-dialog" ms-widget="{dialog:@acRecordDialog}" >
        <p>
            若您申请取款，则以下活动资格将会被取消，
            同时已赠送的金额（{{@extractActivity.sumBonusOutAmount+@extractActivity.currenyName}}）将从账户中扣除，
            如有疑问，请联系客服。
        </p>
        <table class="table mtop10">
            <thead>
                <tr>
                    <th :for="th in @acRecordDialog.thList">{{@th.label}}</th>
                </tr>
            </thead>
            <tbody>
                <tr :for="tr in @acRecordDialog.list">
                    <td :for="th in @acRecordDialog.thList"
                        :class="@th.className"
                        :html="avalon.isFunction(@th.text) ? @th.text(@tr) : @tr[@th.text]"></td>
                </tr>
            </tbody>
        </table>
    </xmp>
    <!-- 活动记录的弹窗  start -->
</div>